package demo1;

import java.util.Arrays;

public class Soluton {
    public  String setstring (String str) {

        if(str == null | str.length() == 0) {
            return null;
        }

        char [] a = new char[26];
        int total = 0;
        for (int i = 0; i < str.length(); i++) {
            /*int flag = 0;*/
            char ch = str.charAt(i);
           /* a[total] = ch ;*/
            for (int j = 0; j < a.length; j++) {
                if(ch != a[j]) {
                    a[total] = ch ;
                    total++;
                }
               /* if(j != total) {
                    if (a[total] == a[j]) {
                        flag = 1;
                        break;
                    }
                }*/
            }
          /*  if (flag == 0) {
                total++;
            }*/
        }
        return Arrays.toString(a);

    }

    public static void main(String[] args) {
        Soluton k = new Soluton();
        String first = "BAabB";
        System.out.println(k.setstring(first));
    }
}
